package il.ac.braude.sona.entities;

import il.ac.braude.sona.constants.DatabaseScheme;
import il.ac.braude.sona.gui.list_table.FieldInfo;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
/**
 * Entity for periodic report, will be used to show previous reports
 * the report will be chosen from the reports table
 * @author <p>SONA, Sasha,Ofek,Nitzan and Avihai, Group 6, <br>Laboratory in Software Engineering,Ort Braude College.</p>
 */
public class PeriodicReport implements Serializable {
   /**
    * variables that will be visible in the reports table
    */
	@FieldInfo(name="Report ID", isVisibleOnTable = true)
	private String reportid;
	@FieldInfo(name="From", isVisibleOnTable = true)
	private String from;
	@FieldInfo(name="To", isVisibleOnTable = true)
	private String to;
	@FieldInfo(name="Hour created", isVisibleOnTable = true)
	private String hour;

	
	/**
	 * Constructor for periodic report
	 * creates a new periodic report, getting values from the given result set
	 * @param rs - the result set who contains all the fields of the report
	 * @throws SQLException
	 */
	public PeriodicReport(ResultSet rs) throws SQLException {
		this.from = rs.getString(2);
		this.to = rs.getString(3);
		this.hour = rs.getString(4);
		this.reportid = rs.getString(1);
		}
	
	/**
	 * @return report id
	 */
	public String getReportid() {
		return reportid;
	}
/**
 * sets report id
 * @param reportid - the report id to be set
 */
	public void setReportid(String reportid) {
		this.reportid = reportid;
	}
/**
 * @return the date of which the report was asked
 */
	public String getFrom() {
		return from;
	}
/**
 * sets the date which the report was asked
 * @param from - the dateto be set
 */
	public void setFrom(String from) {
		this.from = from;
	}
/**
 * @return the date which the report had ended
 */
	public String getTo() {
		return to;
	}
/**
 * sets the date which the report had ended
 * @param to - the date to be set
 */
	public void setTo(String to) {
		this.to = to;
	}
/**
 * @return the time which the report was created
 */
	public String getHour() {
		return hour;
	}
/**
 * sets the time which the report was created
 * @param hour - time to be set
 */
	public void setHour(String hour) {
		this.hour = hour;
	}






}
